<%@include file="init.jsp" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <%@include file="head.jsp" %>
        <script type="text/javascript" src="js/jquery_1.js" language="JavaScript"></script>
        <script type="text/javascript" src="js/ajax.js" language="JavaScript"></script>
    </head>
    <body>
        <div id="page">
            <%@include file="menu.jsp" %>

            <div id="main-content">
                <h3>Gestionar Estadios</h3>
                <table id="tabla_combates" class="tablaGris">
                    <tr>
                        <th>Estadio</th>
                        <th>Aforo</th>
                        <th>Modificar</th>
                        <th>Borrar</th>
                    </tr>
                    <logic:notEmpty name="EstadiosForm" property="listadoEstadios">
                        <logic:iterate name="EstadiosForm" property="listadoEstadios" id="estadio">
                            <tr id="${estadio.idEstadio}">
                                <td>
                                    <bean:write name="estadio" property="nombre"/>
                                </td>
                                <td>
                                    <bean:write name="estadio" property="aforo"/>
                                </td>
                                <td>
                                    <html:link action="ModificarEstadio.do?idEstadio=${estadio.idEstadio}" >
                                        <html:img src="images/modificar.png" alt="modificar" style="margin-left:15px;width:30px;" />
                                    </html:link>
                                </td>
                                <td>
                                    <html:img src="images/borrar.jpg" alt="borrar" style="margin-left:15px;width:30px;" onclick="borrarEstadio(${estadio.idEstadio});"/>
                                </td>
                            </tr>
                        </logic:iterate>
                    </logic:notEmpty>
                </table> 
                <hr/>
                <h3>Nuevo Estadio</h3>
                <html:form action="NuevoEstadio.do" method="POST">
                    <html:submit value="Nuevo Estadio" />
                </html:form>
            </div>
        </div>
    </body>
</html>